<template>
	<u-cell-group>
		<u-cell-item v-if="selectedFields.includes(26) || displayAll" :arrow="false" title="老板名称" :value="data.BossName"></u-cell-item>
		<u-cell-item v-if="selectedFields.includes(27) || displayAll" :arrow="false" title="老板手机号" :value="data.BossPhone"></u-cell-item>
		<u-cell-item v-if="selectedFields.includes(28) || displayAll" :arrow="false" title="老板生日" :value="birthday"></u-cell-item>
		<u-cell-item v-if="selectedFields.includes(29) || displayAll" :arrow="false" title="是否VIP">
			<u-radio-group :value="data.IsVIP">
				<u-radio :disabled="true" :name="1">是</u-radio>
				<u-radio :disabled="true" :name="0">否</u-radio>
			</u-radio-group>
		</u-cell-item>
		<u-cell-item v-if="selectedFields.includes(30) ||displayAll" :arrow="false" title="祝福备注">
			<u-input :disabled="true" placeholder="" :value="data.BlessingNote" :customStyle="{ fontSize: '26rpx', color: '#909399'}" type="textarea" inputAlign="right"></u-input>
		</u-cell-item>
	</u-cell-group>
</template>

<script>
export default {
	name: 'boss-information',
	props: {
		level: {
			type: [Number, String],
			default: 1
		},
		selectedFields: {
			type: Array,
			default() {
				return []
			}
		},
		displayAll: {
			type: Boolean,
			default: true
		},
		data: {
			type: Object,
			default() {
				return {
					BossName: '',
					BossPhone: '',
					BossBirthday: null,
					IsVIP: null,
					BlessingNote: ''
				}
			}
		}
	},
	data() {
		return {};
	},
	
	computed: {
		birthday() {
			if(this.data.BossBirthday) {
				return this.$u.date(this.data.BossBirthday * 1000)
			}else {
				return ''
			}
		}
	},

	methods: {
		addPrefix(text) {
			let prefix = '';
			if (this.level == 1) {
				prefix = '一级';
			}
			if (this.level == 2) {
				prefix = '二级';
			}
			return prefix + text;
		}
	}
};
</script>

<style lang="scss"></style>
